import Vue from 'vue'
import YDUI from 'vue-ydui' /* 相当于import YDUI from 'vue-ydui/ydui.rem.js' */
import 'vue-ydui/dist/ydui.flexible.js'
import 'vue-ydui/dist/ydui.rem.css'
import 'vue-ydui/dist/ydui.base.css'
import axios from 'axios'
import config from '@/config'
// require styles
/* 使用px：import 'vue-ydui/dist/ydui.px.css'; */
Vue.use(YDUI)
let TkAjax = axios.create({
  baseURL: config.baseUrl
})
window._tkAjax = TkAjax
Vue.prototype.$tkAjax = TkAjax
TkAjax.interceptors.response.use(function (res) {
  if (res.status === 200) {
    return res
  } else {
    return Promise.reject(res)
  }
})
